package us.kg.kotoriforest.springmvc.restful.validator;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import us.kg.kotoriforest.springmvc.restful.annotation.Gender;

/**
 * @author Kotori rotroutine@163.com
 * @since 2025/2/8
 */
public class GenderValidator implements ConstraintValidator<Gender, String> {

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return "男".equals(value) || "女".equals(value);
    }
}
